package com.ylx.excel.model;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ylx.excel.excel.model.CapTypeImport;
import com.ylx.excel.utils.ExcelUtils;
import com.ylx.mybatis.utils.SqlCreateUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 能力初始化表
 * </p>
 *
 * @author yanglixin
 * @since 2024-07-09
 */
@Data
@TableName(value = "ac_app_cap_type", autoResultMap = true)
public class AcAppCapType implements Serializable {

    //private static final long serialVersionUID = 1L;

    /**
     * 唯一标识
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @ApiModelProperty("能力名称")
    private String capName;
    @ApiModelProperty("能力类型标识")
    private String capType;
    @ApiModelProperty("能力编码")
    private String capCode;
    @ApiModelProperty("应用的平台类型：1.Android, 2.API, 3.IOS, 4.H5")
    private Integer appPlatformType;
    @ApiModelProperty("能力初始化时的状态 0：正常，1：已停用")
    private Integer statusInit;
    @ApiModelProperty("IDaaS租户是否初始化 0否 1是")
    private Integer tenantInit;
    @ApiModelProperty("IDaaS租户是否可编辑 0否 1是")
    private Integer tenantEdit;
    @ApiModelProperty("业务信息管理是否初始化 0否 1是")
    private Integer managerInit;
    @ApiModelProperty("业务信息管理是否可编辑 0否 1是")
    private Integer managerEdit;
    @ApiModelProperty("是否隐藏编辑/查看按钮 0否 1是")
    private Integer hideEditButton;
    @ApiModelProperty("管理端是否显示 0否 1是")
    private Integer managerShow;
    @ApiModelProperty("场景 1:H5一键登录/本机号码校验/SIM认证: 2:扫码认证")
    private Integer scene;
    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;
    @ApiModelProperty("更新时间")
    private LocalDateTime updateTime;
    @ApiModelProperty("删除标识，0：正常，1：已删除")
    private Integer deleteFlag;

    public static void main(String[] args) {
        List<CapTypeImport> importList = ExcelUtils.importClassPathResourceExcel("能力表.xlsx", CapTypeImport.class);
        StringBuilder stringBuilder = new StringBuilder();
        for (CapTypeImport data : importList) {
            AcAppCapType acAppCapType = BeanUtil.copyProperties(data,AcAppCapType.class);
            stringBuilder.append(SqlCreateUtil.generateInsertSql(acAppCapType));
        }
        System.out.println(stringBuilder);
    }
}
